package org.jpxx.sec.web.admin.ajax;

import org.apache.log4j.Logger;

/**
 * AJAX for login
 * 
 * @author Jun Li lijun@jpxx.org (http://www.jpxx.org)
 * @version 1.0.0 $ org.jpxx.sec.web.admin.ajax.Login.java $ $ Date: 2009-5-10 $
 */
public class Login {

	private Logger log = Logger.getLogger(Login.class);

	public String getLoginHtml() {
		StringBuffer lh = new StringBuffer();
		lh
				.append("<table width=\"100%\" height=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">");
		lh.append("<tr><td align=\"center\">");
		lh
				.append("<form name=\"manage\" method=\"post\" onsubmit=\"checkLogin('error'); return false;\">");
		lh
				.append("<table width=\"800\" height=\"400\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" id=\"loginTable\">");
		lh
				.append("<tr><td><table width=\"100%\" height=\"400\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">");
		lh.append("<tr><td height=\"210\">&nbsp;</td></tr>");
		lh
				.append("<tr><td height=\"60\"><table width=\"800\" height=\"60\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">");
		lh.append("<tr><td width=\"143\" rowspan=\"2\">&nbsp;</td>");
		lh
				.append("<td width=\"203\" rowspan=\"2\" valign=\"bottom\"><input name=\"username\" type=\"text\" autocomplete=\"off\" id=\"username\" value=\"\" title=\"用户名\"></td>");
		lh
				.append("<td width=\"203\" rowspan=\"2\" valign=\"bottom\"><input name=\"password\" type=\"password\" autocomplete=\"off\" id=\"password\" value=\"\" title=\"密码\"></td>");
		lh
				.append("<td width=\"65\" rowspan=\"2\" valign=\"bottom\"><input name=\"code\" type=\"text\" id=\"code\" autocomplete=\"off\" title=\"验证码\" value=\"\"></td>");
		lh
				.append("<td width=\"186\" valign=\"bottom\"><span lang=change_code style=\"font-size:12px; cursor:pointer; color:#0000FF; text-decoration:underline;\" onClick=\"codeImage.src='../verifyCode.html?Number=4&Seed='+new Date().getTime()\"></span></td>");
		lh.append("</tr><tr>");
		lh
				.append("<td height=\"24\" valign=\"bottom\"><img src=\"../verifyCode.html?Number=4&Seed="
						+ System.currentTimeMillis()
						+ "\" title=\"看不清楚，换一张\" alt=\"看不清楚，换一张\" \" id=\"codeImage\" style=\"cursor:pointer;\" onClick=\"this.src='../verifyCode.html?Number=4&Seed='+new Date().getTime();code.value='';\"/></td>");
		lh
				.append("</tr></table></td></tr><tr><td height=\"10\">&nbsp;</td></tr>");
		lh
				.append("<tr><td height=\"60\"><table width=\"800\" height=\"60\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">");
		lh
				.append("<tr><td width=\"143\">&nbsp;</td><td width=\"100\"><input name=\"submit\" type=\"image\" id=\"submit\" src=\"images/login.jpg\" title=\"登陆\" alt=\"登陆\"></td>");
		lh
				.append("<td width=\"100\"><input name=\"reset\" type=\"image\" id=\"reset\" onClick=\"manage.reset(); return false;\" src=\"images/reset.jpg\" title=\"重置\" alt=\"重置\"></td>");
		lh
				.append("<td width=\"457\"><table width=\"457\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td><span id=\"error\"></span></td>");
		lh.append("</tr></table></td>");
		lh
				.append("</tr></table></td></tr><tr><td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
		lh
				.append("<tr><td height=\"25\" align=\"center\"><span id=\"copyright\">");
		lh
				.append("Copyright © 2008, <a href='http://www.jpxx.org' target='_blank'>");
		lh
				.append("<span style=\"color:Blue;\">Jun</span> <span style=\"color:Red;\">L</span>");
		lh
				.append("<span style=\"color:Green;\">i</span></a> all right reserved.");
		lh.append("</span></td>");
		lh
				.append("</tr><tr><td>&nbsp;</td></tr></table></td></tr></table></td></tr></table></form></td></tr></table>");
		return lh.toString();
	}
}
